/**
 * 
 */
package com.acc.softmgr.common.genertor.gen;

import java.sql.SQLException;
import org.apache.velocity.VelocityContext;
import com.acc.softmgr.common.genertor.utils.CommUtil;
import com.acc.softmgr.common.genertor.utils.PageParserUtil;

/**
 * 
 * @content
 * 
 * @date 2017年6月4日
 * 
 * @author OprCalf
 * 
 */
public class GenerateJS extends BaseGenerate {

	public static void genJS(String tableName, String baseJSPath, String jsPath) throws SQLException {
		String className = CommUtil.formatTableNameToClassName(tableName);
		String classNameLower = className.substring(0, 1).toLowerCase() + className.substring(1, className.length());
		VelocityContext context = new VelocityContext();
		context.put("className", className);
		context.put("classNameLower", classNameLower);

		PageParserUtil.WriterPage(context, "JSTemplate.ftl", baseJSPath, jsPath);
	}
}
